home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / comm / www / UrbCedWWW.lha / urbcedwww / rexx / DelVal.ucwx < prev    next >
Encoding:
Text File  |  1998-09-30  |  1.9 KB  |  99 lines

  1. /**************************************************************************/
  2. /*                              DelVal.ucwx                               */
  3. /*                                                                        */
  4. /*                    Copyright ©1998 by Dick Whiting                     */
  5. /*                                                                        */
  6. /*------------------------------------------------------------------------*/
  7. /*               Delete the value portion of a key=value                  */
  8. /*      See the UrbCedWWW Readme for a more complete description.         */
  9. /**************************************************************************/
  10. /*
  11. $VER: 1.0 Copyright ©1998 by Dick Whiting
  12. */
  13.  
  14. options results
  15. Address CYGNUSED
  16.  
  17. startline=-1
  18. endline=-1
  19. startcol=-1
  20. endcol=-1
  21.  
  22. 'CEDTOFRONT'
  23.  
  24. starttag=1
  25.  
  26. 'STATUS NUMLINES'
  27. numlines=result
  28.  
  29. 'STATUS CURSORCOLUMN'
  30. startcol=result+1
  31.  
  32. 'GETCHAR'
  33. char=result
  34.  
  35. do while (char~='=' & char~='"' & char~='>')
  36.    'LEFT'
  37.    'GETCHAR'
  38.    char=result
  39.    'STATUS CURSORCOLUMN'
  40.    colptr=result
  41.    'STATUS CURSORLINE'
  42.    currline=result
  43.    if (colptr=0 & currline=0) then do
  44.       'OKAY1' 'Unable to find beginning of value'
  45.       exit
  46.    end
  47.    startcol=colptr+2
  48. end
  49.  
  50. 'STATUS CURSORLINE'
  51. startline=result+1
  52.  
  53. 'RIGHT'
  54.  
  55. select
  56.    when char='"' then endchar='"'
  57.    when char='>' then endchar='<'
  58.    otherwise endchar=' '
  59. end
  60.  
  61. 'GETCHAR'
  62. char=result
  63.  
  64. do while (char~=endchar & char~='>')
  65.    'RIGHT'
  66.    'GETCHAR'
  67.    char=result
  68.    'STATUS CURSORCOLUMN'
  69.    colptr=result+1
  70.    'STATUS CURSORLINE'
  71.    currline=result
  72.    'STATUS LINEMEMORYLENGTH'
  73.    linelen=result
  74.    if (colptr>=linelen & currline>=numlines) then do
  75.       'OKAY1' 'At end-of-file'
  76.       exit
  77.    end
  78. end
  79.  
  80. 'STATUS CURSORCOLUMN'
  81. endcol=result+1
  82.  
  83. 'STATUS CURSORLINE'
  84. endline=result+1
  85.  
  86. if ((startline>-1) & (endline>-1)) then do
  87.    'LL' startline startcol
  88.    'MARK'
  89.    on=result
  90.    if ~on then 'MARK'
  91.    'LL' endline endcol
  92. end
  93.  
  94. 'CUT'
  95.  
  96. exit
  97.  
  98.  
  99.